package com.demo.validate;

import java.util.regex.Matcher;
import java.util.regex.Pattern;

/**
 * 数字校验
 *
 * @author sdyang
 * @create 2019-01-22 8:56
 **/
public class NumberValidate extends FieldDataValidate {
    @Override
    public boolean check(Object object) {
        Pattern pattern = Pattern.compile("[0-9]*");
        Matcher isNum = pattern.matcher(object.toString());
        if (!isNum.matches()) {
            return false;
        }
        return true;
    }
}
